gtk_entry_completion_set_text_column: reuse old renderer
authorLars Uebernickel <lars@uebernic.de>
Sat, 2 Nov 2013 13:22:33 +0000 (14:22 +0100)
committerLars Uebernickel <lars@uebernic.de>
Sat, 2 Nov 2013 19:14:22 +0000 (20:14 +0100)
commitf6a0debdd9d4f90b9d6b54c263b10926ba530c7e
tree58cb26a4b73b392e629800b5cc15eb66e3c0f7bd
parent88e2c0ee69c34b6ff5da9949946f6b7ec3b07494
gtk_entry_completion_set_text_column: reuse old renderer

gtk_entry_completion_set_text_column() always added a cell renderer,
regardless of whether there was an existing one already installed.  This
patch reuses an old renderer if it exists, but only if it was added by a
previous call to this function.

To avoid conflicts, all renderers that were added manually are removed
when calling this function. Also, the renderer added by this function is
removed when manually adding new renderers. This effectively gives
GtkEntryCompletion two modes (managed and manual cell renderers) and
allows seamless switching between the two.

This is a minor API break. However, this shouldn't be an issue in
practice as applications couldn't call set_text_column() more than once
because of this bug. Also, it is unlikely that many applications mix
set_text_column() and custom cell renderers. The interaction between the
two modes was erratic and not documented well.

https://bugzilla.gnome.org/show_bug.cgi?id=635499
gtk/gtkentrycompletion.c